home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / lightwave / arexx_macros / points2spheres.lwm < prev    next >
Text File  |  1996-12-09  |  2KB  |  77 lines

  1. /* Points to Spheres - for use in Lightwave Modeler
  2.  * Convert selected points to spheres. (Cuts initial object)
  3.  * By Monte Ohrt © 1994 The Rendering Plant Inc.
  4.  * e-mail mohrt@cse.unl.edu if you have comments etc.  */
  5.  
  6.  
  7.  
  8. Version = 1.0
  9. call addlib "LWModelerARexx.port", 0
  10. sysnam = 'Points To Spheres'
  11. signal on error
  12. signal on syntax
  13.  
  14. call sel_mode(USER)
  15. csurf=CurSurface()
  16.  
  17. call req_begin sysnam
  18.  
  19. id_txt = req_addcontrol("Convert Points",'T',"to Spheres")
  20. id_typ = req_addcontrol("Sphere Type", 'CH',"Globe Tesselated")
  21. id_srf = req_addcontrol("Surfaces",'R')
  22. id_tes = req_addcontrol("Tesselation Level", 'n')
  23. id_rad = req_addcontrol("Radius",'v',1)
  24. id_sid = req_addcontrol("Globe Sides",'n')
  25. id_seg = req_addcontrol("Globe Segments",'n')
  26. call req_setval id_typ, 1
  27. call req_setval id_tes, 2
  28. call req_setval id_rad, .5
  29. call req_setval id_sid, 16
  30. call req_setval id_seg, 8
  31. if (~req_post()) then do
  32.     call req_end
  33.     exit
  34. end
  35. type = req_getval(id_typ)
  36. tess = req_getval(id_tes)
  37. surf = req_getval(id_srf)
  38. rad = req_getval(id_rad)
  39. side = req_getval(id_sid)
  40. segs = req_getval(id_seg)
  41. call req_end()
  42. say surf Csurf
  43. if surf~=CSurf then call surface(surf)
  44.  
  45. n = xfrm_begin()
  46. say n
  47. do i = 1 to n
  48.   Point.i= xfrm_getpos(i)
  49.   say Point.i
  50.   end
  51. call xfrm_end()
  52. call CUT()
  53. call meter_begin n+1, 'Creating Spheres'
  54. do i=1 to n
  55.   if (type=1) then do
  56.     call MAKEBALL(rad,side,segs,point.i)
  57.     call meter_step
  58.     end
  59.   else do
  60.     call MAKETESBALL(rad,tess,point.i)
  61.     call meter_step
  62.     end
  63.   end
  64. call remlib "LWModelerARexx.port"
  65. exit
  66.  
  67. syntax:
  68. error:
  69.   call end_all
  70.    t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
  71.    exit
  72.  
  73. PointCount: PROCEDURE
  74.   n=XFRM_BEGIN()
  75.   call END_ALL()
  76.   return n
  77.